﻿function loadContent(){
	var obj=new Array()
	$.ajax({url: 'http://localhost/bongda365/service.php?name=newsdetail&id=9451',
		dataType:'json',
		success: onSuccess, 
		error: onFail});
};

function onSuccess(data,stt){
	alert('enter ajax call');
	var title = document.getElementById('title');
	var description = document.getElementById('description');
	var content = document.getElementById('content');
	title.innerHTML = data.displayname;
	description.innerHTML = data.description;
	content.innerHTML = data.content;
	$("p").each(function(){
		if($(this).css("text-align") == "center") $(this).addClass("center");
	});
	$("p").removeAttr("style");
	$("img").removeAttr("style");
	$("img").removeAttr("width");
	$("img").removeAttr("height");
	$("img").each(function(){
		$(this).width($("#content").width());
	});
	$("img").removeAttr("alt");
}

function onFail(a,b,c){
	alert(a);
	alert(b);
	alert(c);
}